package com.mitake.nick;

import java.io.File;
import java.io.IOException;
import java.net.URL;

import org.apache.commons.io.FileUtils;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.xml.sax.SAXException;

import com.mitake.nick.util.ReadXmlUtil;

public class TestXml {

	/**
	 * @param args
	 * @throws DocumentException 
	 * @throws IOException 
	 * @throws SAXException 
	 */
	public static void main(String[] args) throws DocumentException, SAXException, IOException {
		
		String data = ReadXmlUtil.getUrlData("99039");
		
		System.out.println(data);
		
//		SAXReader reader = new SAXReader();
//		Document doc = reader.read(new URL("http://10.1.99.159:8888/SpWebUserProfile?UserName=99039"));
//        
//		Element root = doc.getRootElement();
//		Element element;
//		
//		String tempStr = "";
//		String[] data;
//		while(root.elementIterator("row").hasNext()){
//			element = (Element) root.elementIterator("row").next();
//			tempStr = element.elementText("profile");
//			System.out.println(tempStr);
//			
//			FileUtils.writeStringToFile(new File("C:/SmsTemp/tempFile"), tempStr);
//			
//			data = tempStr.split(",");
//			
//			for(int i = 0; i < data.length; i++){
//				System.out.println(data[i]);
//			}
//			break;
//		}
	}
}
